package com.kis.ioc.core;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by yks on 15-11-14.
 */
public class BeanMap {
    private static Map<String,Object> beans = new HashMap<String,Object>();

    private BeanMap(){}
    /**
     * 添加bean
     * @param beanName
     * @param value
     */
    public  static void put(String beanName ,Object value){
        beans.put(beanName, value);
    }

    /**
     * 获得bean
     * @param beanName
     * @return
     */
    public static Object getBean(String beanName){
        if(!beans.isEmpty()){
            return beans.get(beanName);
        }
        return new HashMap<String,Object>();
    }

    public static Map<String,Object> getBeanMap(){
        return beans;
    }
}
